<%@page language="java" pageEncoding="UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
    <%
        response.setHeader("Pragma", "No-cache");
        response.setHeader("Cache-Control", "no-cache");
        response.setHeader("Expires", "0");
    %>
    <title>网络服务平台</title>
    <link rel="stylesheet" type="text/css" href="/js/easyui/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="/js/easyui/themes/icon.css">
    <script type="text/javascript" src="/js/easyui/jquery-1.7.1.min.js"></script>
    <script type="text/javascript" src="/js/easyui/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="/js/easyui/locale/easyui-lang-zh_CN.js"></script>
    <script>
        $(function () {
            $('#lastUpdate').datetimebox({
                showSeconds:false
            });
        });

        function save() {
            $("#newsSourceForm").form({
                onSubmit:function () {
                    return $(this).form('validate');
                },
                success:function () {
                    window.location.href = "/management/news/newsSourceIndex.action";
                }
            });

            $("#newsSourceForm").submit();
        }

    </script>
</head>

<body class="easyui-layout" onKeyDown="if(window.event.keyCode==8)window.event.returnValue=false">
<s:if test="null == #session._login_user_">
    <script type="text/javascript">
        top.location.href = '/admin';
    </script>
</s:if>
<div region="center" style="height:800px;padding:10px;background:#efefef;">
    <div id="p" class="easyui-panel" title="新闻源" icon="icon-search" style="height:780px;padding:10px;">
        <form id="newsSourceForm" action="/management/news/newsSourceSaveOrUpdate.action" method="post">
            <table id="subtitle" border="1" width="100%"
                   style="BORDER-COLLAPSE: collapse;FONT-SIZE: 13px;FONT-FAMILY: arial;nowrap: true">
                <tr>
                    <td width="20%"><label>名称：</label></td>
                    <td><input class="easyui-validatebox" id="name" name="newsSource.source" required="true"
                               style="width: 560px" value="${newsSource.source}"/></td>
                </tr>
                <tr>
                    <td width="20%"><label>startUrl：</label></td>
                    <td><input class="easyui-validatebox" id="url" required="true" name="newsSource.startUrl" value="${newsSource.startUrl}" style="width: 560px"/></td>
                </tr>
                <tr>
                    <td width="20%"><label>最近更新：</label></td>
                    <td><input name="newsSource.lastUpdate" id="lastUpdate"
                               value="<s:date name="newsSource.lastUpdate" format="yyyy-MM-dd HH:mm:ss"/>"
                               style="width:150px">
                    </td>
                </tr>
                <tr>
                    <td width="20%"><label>图片目录：</label></td>
                    <td><input id="imageFolder" required="true" name="newsSource.imageFolder" value="${newsSource.imageFolder}" style="width: 560px"/></td>
                </tr>
                <tr>
                    <td width="20%"><label>列表：</label></td>
                    <td><input id="listSelector" name="newsSource.listSelector" value="${newsSource.listSelector}" style="width: 560px"/></td>
                </tr>
                <tr>
                    <td width="20%"><label>列表下一页：</label></td>
                    <td><input id="listNext" name="newsSource.listNext" value="${newsSource.listNext}" style="width: 560px"/></td>
                </tr>
                <tr>
                    <td width="20%"><label>列表下一页前缀：</label></td>
                    <td><input id="listBasePath" name="newsSource.listBasePath" value="${newsSource.listBasePath}" style="width: 560px"/></td>
                </tr>
                <tr>
                    <td width="20%"><label>标题：</label></td>
                    <td><input id="title" name="newsSource.title" value="${newsSource.title}" style="width: 560px"/></td>
                </tr>
                <tr>
                    <td width="20%"><label>摘要：</label></td>
                    <td><input id="introduction" name="newsSource.introduction" value="${newsSource.introduction}" style="width: 560px"/></td>
                </tr>
                <tr>
                    <td width="20%"><label>日期Selector：</label></td>
                    <td><input id="date" name="newsSource.date" value="${newsSource.date}" style="width: 560px"/></td>
                </tr>
                <tr>
                    <td width="20%"><label>日期格式：</label></td>
                    <td><input id="dateFormat" name="newsSource.dateFormat" value="${newsSource.dateFormat}" style="width: 560px"/></td>
                </tr>
                <tr>
                    <td width="20%"><label>作者：</label></td>
                    <td><input id="author" name="newsSource.author" value="${newsSource.author}" style="width: 560px"/></td>
                </tr>
                <tr>
                    <td width="20%"><label>正文：</label></td>
                    <td><input id="context" name="newsSource.context" value="${newsSource.context}" style="width: 560px"/></td>
                </tr>
                <tr>
                    <td width="20%"><label>文章下一页：</label></td>
                    <td><input id="next" name="newsSource.next" value="${newsSource.next}" style="width: 560px"/></td>
                </tr>
                <tr>
                    <td width="20%"><label>文章下一页base：</label></td>
                    <td><input id="nextBasePath" name="newsSource.nextBasePath" value="${newsSource.nextBasePath}" style="width: 560px"/></td>
                </tr>
                <tr>
                    <td width="20%"><label>图片Base：</label></td>
                    <td><input id="imageBasePath" name="newsSource.imageBasePath" value="${newsSource.imageBasePath}" style="width: 560px"/></td>
                </tr>
                <tr>
                    <td align="center" colspan="2">
                        <a class="easyui-linkbutton" onClick="save()">保存</a>
                        <a class="easyui-linkbutton" onClick="javascript:history.back()">取消</a>
                    </td>
                </tr>
            </table>
            <input type="hidden" name="newsSource.id" value="${newsSource.id}"/>
        </form>
    </div>
</div>
</body>
</html>
